package com.xuan.yupao.service;

import com.xuan.yupao.model.domain.Message;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xuan.yupao.model.domain.vo.MessageVo;
import com.xuan.yupao.model.domain.vo.PrivateMessageVo;

import java.util.List;

/**
* @author 清凉茶
* @description 针对表【message(消息表)】的数据库操作Service
* @createDate 2024-07-10 13:20:31
*/
public interface MessageService extends IService<Message> {

    /**
     * 获取未读私聊消息的总数
     *
     * @param receiveId
     * @return
     */
    Long getNoRereadMessageNum(Long receiveId);


    /**
     * 获取私聊信息列表
     *
     * @param receiveId 消息接收方/登录用户id
     * @return
     */
    List<PrivateMessageVo> getPrivateChatList(Long receiveId);

    /**
     *  获取与特定用户的聊天记录
     * @param toId  聊天用户id
     * @param loginUserId   登录用户id
     * @return
     */
    List<MessageVo> getPrivateChatHistory(Long toId, Long loginUserId);

    /**
     *  获取当前用户所在队伍的聊天记录
     * @param teamId 队伍id
     * @param loginUserId 登录用户id
     * @return
     */
    List<MessageVo> getTeamChatHistory(Long teamId, Long loginUserId);

    /**
     *  确认未读消息
     * @param remoteId
     * @param loginUserId
     * @return
     */
    boolean confirmUnreadMessage(Long remoteId, Long loginUserId);


    /**
     *  获取大厅的聊天记录
     * @param userId
     * @return
     */
    List<MessageVo> getHallChatHistory(Long userId);
}
